package com.eoner.managerlibrary.netsign;

import android.text.TextUtils;

import com.eoner.baselib.utils.sp.SPUtils;
import com.eoner.common.BuildConfig;
import com.eoner.common.config.Config;

public class NetEnvManager {

    /*--------- 测试服务器----------*/
    public static final String BASE_URL_KEY = "base_url_key";
    public static final String BASE_SURL_KEY = "base_surl_key";
    public static final String BASE_RURL_KEY = "base_rurl_key";


    //正式服务器
    //静态API
    public static String BASE_URL = !BuildConfig.DEBUG ?  "https://apida.3dintime.com/" : "https://apida.3dintime.com/";
    //直播间专用url
    public static String BASE_R_URL =!BuildConfig.DEBUG ?  "https://apida.3dintime.com/" : "https://apida.3dintime.com/";//动态API
    //老接口
    public static String BASE_SURL =  !BuildConfig.DEBUG ?  "https://apida.3dintime.com/" : "https://apida.3dintime.com/";//API



    /**
     * 设置接口环境
     * */
    public static void configNetServiceEnv() {
        if (BuildConfig.ISENV) {
            //记住上次选择环境代码 上线代码一定要注释掉
            String base_url = SPUtils.getInstance().getString(BASE_URL_KEY);
            if(!TextUtils.isEmpty(base_url)){
                BASE_URL = base_url;
            }
            String base_surl = SPUtils.getInstance().getString(BASE_SURL_KEY);
            if(!TextUtils.isEmpty(base_surl)){
                BASE_SURL = base_surl;
            }
            String base_rurl = SPUtils.getInstance().getString(BASE_RURL_KEY);
            if(!TextUtils.isEmpty(base_rurl)){
                BASE_R_URL = base_rurl;
            }
            String gzg_test_user = SPUtils.getInstance().getString(Config.GZG_TEST_USER_KEY);
            if(!TextUtils.isEmpty(gzg_test_user)){
                Config.GZG_TEST_USER = gzg_test_user;
            }
        }
    }


}
